package com.huajin.gateway.nmap.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.huajin.gateway.nmap.dao.AssetDao;
import com.huajin.gateway.nmap.domain.AssetDO;
import com.huajin.gateway.nmap.service.AssetService;


@Service
public class AssetServiceImpl implements AssetService {
    @Autowired
    private AssetDao assetDao;

    @Override
    public AssetDO get(Integer id) {
        return assetDao.get(id);
    }

    @Override
    public List<AssetDO> list(Map<String, Object> map) {
        return assetDao.list(map);
    }

    @Override
    public int count(Map<String, Object> map) {
        return assetDao.count(map);
    }

    @Override
    public int save(AssetDO asset) {
        return assetDao.save(asset);
    }

    @Override
    public int update(AssetDO asset) {
        return assetDao.update(asset);
    }

    @Override
    public int remove(Integer id) {
        return assetDao.remove(id);
    }

    @Override
    public int batchRemove(Integer[] ids) {
        return assetDao.batchRemove(ids);
    }

    @Override
    public int getTheLastId() {
        Integer lastId = assetDao.getTheLastId();
        if (lastId == null) {
            return 1;
        }
        return lastId + 1;
    }


}
